<?php if (!defined('THINK_PATH')) exit(); /*a:6:{s:64:"E:\www\paobanglang\nav/../application/admin\view\file\index.html";i:1507520428;s:63:"E:\www\paobanglang\nav/../application/admin\view\Main\menu.html";i:1514443605;s:67:"E:\www\paobanglang\nav/../application/admin\view\Public\header.html";i:1512184095;s:66:"E:\www\paobanglang\nav/../application/admin\view\public\pages.html";i:1507520616;s:70:"E:\www\paobanglang\nav/../application/admin\view\Main\menu_footer.html";i:1510984673;s:67:"E:\www\paobanglang\nav/../application/admin\view\Public\footer.html";i:1516863870;}*/ ?>
﻿<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>后台管理</title>
   
    <link rel="stylesheet" href="__STATIC__/admin/css/amazeui.min.css" />
    <link rel="stylesheet" href="__STATIC__/admin/css/admin.css">
    <link rel="stylesheet" href="__STATIC__/admin/css/style.css">
    <link rel="stylesheet" href="__STATIC__/admin/css/pintuer.css">
    <link rel="stylesheet" href="__STATIC__/admin/css/app.css">
    <script src="__STATIC__/admin/js/jquery.min.js"></script>
    <script src="__STATIC__/admin/js/amazeui.min.js"></script>
    <script src="__STATIC__/admin/js/pintuer.js"></script>
    <script src="__STATIC__/admin/js/app.js"></script>
    <script type="text/javascript" src="__STATIC__/admin/layer/layer.js"></script>
    <script type="text/javascript" src="__STATIC__/admin/laydate/laydate.js"></script>
    <script type="text/javascript" src="__STATIC__/admin/laytpl/laytpl.js"></script>
</head>
<body>
<header class="am-topbar am-topbar-inverse admin-header">
    <div class="am-topbar-brand">
        <a href="javascript:;" class="tpl-logo">
            <img src="__STATIC__/admin/images/logo.png">
        </a>
    </div>
    <div class="am-icon-list tpl-header-nav-hover-ico am-fl am-margin-right"></div>
    <button class="am-topbar-btn am-topbar-toggle am-btn am-btn-sm am-btn-success am-show-sm-only" data-am-collapse="{target: '#topbar-collapse'}"><span class="am-sr-only">导航切换</span> <span class="am-icon-bars"></span></button>
    <div class="am-collapse am-topbar-collapse" id="topbar-collapse">
        <ul class="am-nav am-nav-pills am-topbar-nav am-topbar-right admin-header-list tpl-header-list">
            <!--<li title="清除缓存">
                <a href="javascript:clear_cache()" class="tpl-header-list-link">
                    清除缓存
                </a>
            </li>-->
            <li title="注销登录">
                <a href="<?php echo url('admin/login/quit'); ?>" class="tpl-header-list-link">
                    <span class="am-icon-sign-out tpl-header-list-ico-out-size"></span>
                </a>
            </li>
        </ul>
    </div>
</header>
<div class="tpl-page-container tpl-page-header-fixed">
    <div class="tpl-left-nav tpl-left-nav-hover" style="margin-left: -10px">
        <div class="tpl-left-nav-title">
            导航列表
        </div>
        <div class="tpl-left-nav-list">
            <ul class="tpl-left-nav-menu">
                <?php foreach($menu_list as $menu): ?>
                    <li class="tpl-left-nav-item">
                        <?php 
                            $b = 0;
                            foreach($menu['child'] as $k => $v){
                                if (strtolower(request()->controller().'/'.request()->action()) == $v['url']){
                                    $b = 1;
                                    break;
                                }
                            }
                           //dump($menu['child']);
                         ?>
                        <a class="nav-link tpl-left-nav-link-list" <?php if($b == 1): ?> class="active" <?php endif; ?>>
                            <i class="<?php echo $menu['icon']; ?>"></i>
                            <span><?php echo $menu['name']; ?></span>
                            <?php if(count($menu['child']) > 0): ?>
                                <i class="am-icon-angle-right tpl-left-nav-more-ico am-fr am-margin-right tpl-left-nav-more-ico-rotate"></i>
                            <?php endif; ?>
                        </a>
                        <?php if(count($menu['child']) > 0): ?>
                            <ul class="tpl-left-nav-sub-menu" style="display:<?php if($b != 1): ?>none<?php else: ?>block<?php endif; ?>;">
                                <li>
                                    <?php foreach($menu['child'] as $menu_child): ?>
                                        <a href="__ROOT__/admin/<?php echo $menu_child['url']; ?>" id="<?php echo request()->controller(); ?>/<?php echo request()->action(); ?>" <?php if(strtolower(request()->controller().'/'.request()->action()) == $menu_child['url']): ?> class="active"<?php endif; ?>>
                                            <i class="am-icon-angle-right"></i>
                                            <span><?php echo $menu_child['name']; ?></span>
                                            <!--<i class="am-icon-star tpl-left-nav-content-ico am-fr am-margin-right"></i>-->
                                        </a>
                                    <?php endforeach; ?>
                                </li>
                            </ul>
                        <?php endif; ?>
                    </li>
                <?php endforeach; ?>
            </ul>
        </div>
    </div>
</div>

<style>
    .am-dropdown{
        width: 100%;
        padding-left: 30px;
        margin-bottom: 10px;
    }
    .am-dropdown div{
        color: #000;
    }
</style>
<div class="tpl-content-wrapper">
<form method="post">
	<div class="panel admin-panel" style="background: #fff">
		<div class="panel-head"><strong><?php echo lang('currency')['list']; ?></strong></div>
		<div class="padding border-bottom">
			<input type="button" class="button button-small checkall" name="checkall" checkfor="id" value="<?php echo lang('currency')['all_select']; ?>" onclick="Select_All()" />
			&nbsp;<?php echo lang('label')['type']; ?> :
			 <a type="button" class="<?php if(input('get.type')=='image' || input('get.type')==''): ?>bg-green text-white<?php endif; ?> button button-small border-green" href="?type=image" /><?php echo lang('currency')['image']; ?></a>
			 <a type="button" class="<?php if(input('get.type')=='audio'): ?>bg-green text-white<?php endif; ?> button button-small border-green" href="?type=audio" /><?php echo lang('currency')['audio']; ?></a>
			 <a type="button" class="<?php if(input('get.type')=='video'): ?>bg-green text-white<?php endif; ?> button button-small border-green" href="?type=video" /><?php echo lang('currency')['video']; ?></a>
			 <a type="button" class="<?php if(input('get.type')=='other'): ?>bg-green text-white<?php endif; ?> button button-small border-green" href="?type=other" /><?php echo lang('currency')['other']; ?></a>
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo lang('label')['handle']; ?> :
				<a id="select_del" type="button" class="button button-small border-red" href="#" /><?php echo lang('currency')['del']; ?></a>
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span><?php echo lang('label')['size']; ?> :</span><?php echo sprintf('%.2f',$size/1024); ?>Kb
		</div>
		<table class="table table-hover">
			<tr>
				<th width="100"><?php echo lang('label')['select']; ?></th>
				<?php if($type=='image'): ?><th width="120"><?php echo lang('label')['image']; ?></th><?php endif; ?>
				<th width="120"><?php echo lang('label')['type']; ?></th>
				<th width="120"><?php echo lang('label')['url']; ?></th>
				<th width="120"><?php echo lang('label')['size']; ?></th>
				<th width="200"><?php echo lang('label')['time']; ?></th>
			</tr>
			<?php if(is_array($data) || $data instanceof \think\Collection || $data instanceof \think\Paginator): $i = 0; $__LIST__ = $data;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$volist): $mod = ($i % 2 );++$i;?>
			<tr>
				<td >
					<input type="checkbox" name="box" value="<?php echo $volist['id']; ?>" />
				</td>
				<?php if($type=='image'): ?><td><img height="40" src="<?php echo $volist['url']; ?>"/></td><?php endif; ?>
				<td style="line-height:40px"><?php echo $volist['type']; ?></td>
				<td style="line-height:40px">
					<a href="<?php echo $volist['url']; ?>"><?php echo $volist['url']; ?></a>
				</td>
				<td style="line-height:40px"><?php echo sprintf('%.2f',$volist['size']/1024); ?>Kb</td>
				<td style="line-height:40px"><?php echo date("y-m-d",$volist['time']); ?></td>
			</tr>
			<?php endforeach; endif; else: echo "" ;endif; ?>
		</table>
		<?php if($pages['pagetotal'] > 1): 
		$get_arr = request()->get();
		$parameters = '';
		if(count($get_arr) > 0){
			foreach($get_arr as $k => $v){
				if($k != 'page'){
					$parameters .= '&'.$k.'='.$v;
				}
			}
		}
	 ?>
	<div class="am-cf" style="margin-right: 20px;">
		<div class="am-fr">
			<ul class="am-pagination tpl-pagination">
				<li><a href="#">共<?php echo $pages['total']; ?>条数据</a></li>
				<?php if($pages['page'] > 1): ?>
					<li><a href="?page=1<?php echo $parameters; ?>">«</a></li>
				<?php endif; $__FOR_START_3934__=$pages['page']-2;$__FOR_END_3934__=$pages['page']+3;for($i=$__FOR_START_3934__;$i < $__FOR_END_3934__;$i+=1){ if($i > 0 && $i <= $pages['pagetotal']): ?>
						<li <?php if($pages['page'] == $i): ?>class="am-active"<?php endif; ?>>
							<a href="?page=<?php echo $i; ?><?php echo $parameters; ?>"><?php echo $i; ?></a>
						</li>
					<?php endif; } if($pages['page'] < $pages['pagetotal']): ?>
					<li><a href="?page=<?php echo $pages['pagetotal']; ?><?php echo $parameters; ?>">»</a></li>
				<?php endif; ?>
			</ul>
		</div>
	</div>
<?php endif; ?>

	</div>
</form>
<script>
function Select_All() {
	var box = $("input[name='box']");
	for (var i in box){
		box[i].checked = !box[i].checked;
	}
}
$('#select_del').click(function(){
	var str="";
	$("input:checkbox[name='box']:checked").each(function(){
		str+=$(this).val()+",";
	});
	if(str!=''){
		if(confirm("<?php echo lang('currency')['del']; ?>?")){location.href='__URL/del.html?id='+str+'&type=<?php echo input("get.type"); ?>&page=<?php echo input("get.page"); ?>';}
	}
});
</script>
</div>
<script src="__STATIC__/admin/js/jquery.min.js"></script>
<script src="__STATIC__/admin/js/amazeui.min.js"></script>
<script src="__STATIC__/admin/js/pintuer.js"></script>
<script src="__STATIC__/admin/js/app.js"></script>
<script type="text/javascript" src="__STATIC__/admin/layer/layer.js"></script>
<script type="text/javascript" src="__STATIC__/admin/layer/extend/layer.ext.js"></script>
<script type="text/javascript" src="__STATIC__/admin/laydate/laydate.js"></script>
<script type="text/javascript" src="__STATIC__/admin/laytpl/laytpl.js"></script>
<script>
    $('.upload').on('click',function (){
            var id = $(this).attr('data-id');
            upload(id);
        }
    );
    function upload(id){
        layer.open({
            type:2,
            title:false,
            area: ['70%', '90%'],
            offset: '5%',
            content: "<?php echo url('/admin/material'); ?>?id="+id
        });
    }
</script>
<?php if(request()->isPost()): ?>
<script>
    layer.msg('操作完成！');
    setTimeout(function (){
        parent.window.location.href = parent.window.location.href;
    },800);
</script>
<?php endif; ?>
</body>
</html>